package com.teamclub.domain.pay.order;

import io.ebean.Model;
import io.ebean.Finder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

@Entity
@Table(name = "pay_order")
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class PayOrder extends Model{
    @Id
    private Integer id ;  // 主键
    private String organNo; // 所属机构
    private String thirdType; //第三方类型 weixin, alipay, qq
    private String userNo;   // 用户
    private String userName; //用户名
    private String orderNum;  // 订单号
    private String thirdOrderNum;
    private String goods;  // 商品名称
    private String feeType; // 货币类型
    private Integer totalFee; //交易总额 （分为单位）
    @Transient
    private BigDecimal totalFeeY; // 交易总额 (元为单位)
    private String tradeType ; // 交易类型  APP
    private Integer payResult = 0; // 0 初始化 1 支付成功 2 支付失败 3 转入退款
    private String payResultMsg;
    @Version
    private Date modifyTime; // 创建时间

    public static Finder<Integer, PayOrder> finder = new Finder<>(PayOrder.class);
}
